package net.borlis.processor.dao.entity;

import net.borlis.processor.dao.entity.AbstractTaskEntity;
import net.borlis.processor.dao.entity.ParameterEntity;
import net.borlis.processor.dao.entity.common.AuditedEntity;
import net.borlis.processor.dao.entity.common.BaseEntity;

import javax.persistence.*;
import java.math.BigInteger;

/**
 * Created by borlis on 24.12.2014.
 */
@Entity
@Table(name = "abstract_task_parameters")
public class AbstractTaskParameterEntity extends BaseEntity implements AuditedEntity {

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    private BigInteger id;

    @ManyToOne
    @JoinColumn(name = "fk_abstract_task_id", nullable = false)
    private AbstractTaskEntity abstractTask;

    @ManyToOne
    @JoinColumn(name = "fk_parameter_id", nullable = false)
    private ParameterEntity parameter;

    @Basic
    @Column(name = "mandatory", nullable = false)
    private Boolean mandatory;

    public AbstractTaskParameterEntity() {
        super();
    }

    public BigInteger getId() {
        return id;
    }

    public void setId(BigInteger id) {
        this.id = id;
    }

    public AbstractTaskEntity getAbstractTask() {
        return abstractTask;
    }

    public void setAbstractTask(AbstractTaskEntity abstractTask) {
        this.abstractTask = abstractTask;
    }

    public ParameterEntity getParameter() {
        return parameter;
    }

    public void setParameter(ParameterEntity parameter) {
        this.parameter = parameter;
    }

    public Boolean getMandatory() {
        return mandatory;
    }

    public void setMandatory(Boolean mandatory) {
        this.mandatory = mandatory;
    }
}
